package org.ysh.service;

import org.ysh.mapper.BaseMapper;

import java.util.List;

public abstract class BaseService <K,T>{

    protected BaseMapper<K,T> baseMapper;

    public BaseService(BaseMapper<K,T> baseMapper) {
        this.baseMapper = baseMapper;
    }

    public List<T> findByPage(T record){
        return baseMapper.findByPage(record);
    }

    public T findById(K id){
        return baseMapper.findById(id);
    }

    public int insert(T record){
        return baseMapper.insert(record);
    }

    public int delete(T t){
        return baseMapper.delete(t);
    }

    public int update(T record){
        return baseMapper.update(record);
    }


}
